/*  1:   */ package org.jeecgframework.poi.excel.view;
/*  2:   */ 
/*  3:   */ import java.net.URLEncoder;
/*  4:   */ import java.util.Collection;
/*  5:   */ import java.util.List;
/*  6:   */ import java.util.Map;
/*  7:   */ import javax.servlet.ServletOutputStream;
/*  8:   */ import javax.servlet.http.HttpServletRequest;
/*  9:   */ import javax.servlet.http.HttpServletResponse;
/* 10:   */ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
/* 11:   */ import org.apache.poi.ss.usermodel.Workbook;
/* 12:   */ import org.jeecgframework.poi.excel.ExcelExportUtil;
/* 13:   */ import org.jeecgframework.poi.excel.entity.ExportParams;
/* 14:   */ import org.springframework.stereotype.Controller;
/* 15:   */ 
/* 16:   */ @Controller("jeecgMapExcelView")
/* 17:   */ public class JeecgMapExcelView
/* 18:   */   extends MiniAbstractExcelView
/* 19:   */ {
/* 20:   */   protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response)
/* 21:   */     throws Exception
/* 22:   */   {
/* 23:51 */     String codedFileName = "临时文件";
/* 24:52 */     Workbook workbook = ExcelExportUtil.exportExcel((ExportParams)model.get("params"), (List)model.get("data"), (Collection)model.get("mapList"));
/* 25:56 */     if (model.containsKey("fileName")) {
/* 26:57 */       codedFileName = (String)model.get("fileName");
/* 27:   */     }
/* 28:59 */     if ((workbook instanceof HSSFWorkbook)) {
/* 29:60 */       codedFileName = codedFileName + ".xls";
/* 30:   */     } else {
/* 31:62 */       codedFileName = codedFileName + ".xlsx";
/* 32:   */     }
/* 33:64 */     if (isIE(request)) {
/* 34:65 */       codedFileName = URLEncoder.encode(codedFileName, "UTF8");
/* 35:   */     } else {
/* 36:67 */       codedFileName = new String(codedFileName.getBytes("UTF-8"), "ISO-8859-1");
/* 37:   */     }
/* 38:69 */     response.setHeader("content-disposition", "attachment;filename=" + codedFileName);
/* 39:70 */     ServletOutputStream out = response.getOutputStream();
/* 40:71 */     workbook.write(out);
/* 41:72 */     out.flush();
/* 42:   */   }
/* 43:   */ }


/* Location:           C:\Users\Administrator\.m2\repository\org\jeecgframework\easypoi-web\2.1.4\easypoi-web-2.1.4\
 * Qualified Name:     org.jeecgframework.poi.excel.view.JeecgMapExcelView
 * JD-Core Version:    0.7.0.1
 */